outputAs

fun <TOutput> outputAs(part: UIMessagePart.ToolUI, serializer: KSerializer<TOutput>): TOutput?

Type-safe extraction at the UI render seam. Pulls a typed TOutput out of UIMessagePart.ToolUI.output. Returns null if state isn't OutputAvailable (caller should branch on state first).

Call as outputAs(part, serializer<Result>()).